# -*- coding:utf-8 -*-
"""
@Author : 审心
@Time : 2023/10/24 15:09
"""
import os
import re

from common.utils import FileUtil


def get_temp_file_path() -> str:
    return os.path.join(os.path.dirname(os.path.abspath(__file__)), "temp_file")


def get_yesterday_str() -> str:
    """
    获取昨日日期字符串形势
    :return:
    """
    from datetime import datetime
    from datetime import timedelta
    return (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")


if __name__ == '__main__':
    paths = FileUtil.find_file_by_like_name(get_temp_file_path(), "2023-10-23")
    for path in paths:
        print(path)
        m = re.search(r'([^_]+)\.xlsx', path)
        if m:
            print(m.group(1))
